package fr.xebia.monitoring.beans.formater;

import fr.xebia.monitoring.MonitoringException;

public class MeasureFormaterFactory {

	public static final String XML_FORMAT = "xml";
	public static final String CSV_FORMAT = "csv";

	public static MeasureFormater createFormater(String format) {
		MeasureFormater formater;
		if (format.equals(XML_FORMAT)) {
			formater = new MeasureXmlFormater();
		} else if (format.equals(CSV_FORMAT)) {
			formater = new MeasureCsvFormater();
		} else {
			throw new MonitoringException("The specified format is unknown: "+format+", please specify xml or csv");
		}
		return formater;
	}

}
